<%--
  Created by IntelliJ IDEA.
  User: root
  Date: 5/11/17
  Time: 11:22 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<div class="modal-body form-horizontal">
    <form name='addBookForm'>

        <div class="form-group">
            <label for="title" class="col-sm-3 control-label">书名：</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="book.title" placeholder="书名" name="title" required >
            </div>
            <div class="col-md-2">
                <p class="form-control-static">
                    <code ng-show="addBookForm.title.$error.required">必填</code>
                </p>
            </div>
        </div>

        <div class="form-group">
            <label for="name" class="col-sm-3 control-label">图书类型：</label>
            <div class="col-md-6">
                <div class="btn-group">
                    <div class="">
                        <input type="radio" ng-model="book.type" id="typeTrue"  name="typeTrue" value="1">
                        <label for="typeTrue">实体书</label>
                    </div>

                    <div class="">
                        <input type="radio" ng-model="book.type" name="typeFalse" id="typeFalse" value="0">
                        <label for="typeFalse">电子书</label>
                    </div>

                </div>
            </div>
        </div>

        <div class="form-group">
            <label for="name" class="col-sm-3 control-label">作者：</label>
            <div class="col-sm-6">
                <input type="text" class="form-control" ng-model="book.author" placeholder="作者" name="author" required />
            </div>
            <div class="col-md-2">
                <p class="form-control-static">
                    <code ng-show="addBookForm.author.$error.required">必填</code>
                </p>
            </div>
        </div>

        <div class="form-group">
            <label for="name" class="col-sm-3 control-label">分类：</label>
            <div class="col-sm-6">
                <js-tree id="local-book-type-tree"
                         tree-plugins="types"
                         tree-data="scope"
                         tree-model="localBookTypeTree"
                         tree-events="ready:ready;select_node:selectNode;deselect_node:deselectNode;open_node:openNode;delete_node:deleteNode;rename_node:renameNode;search:searchNode;">
                </js-tree>
            </div>
        </div>

        <div class="form-group">
            <label for="name" class="col-sm-3 control-label">描述：</label>
            <div class="col-sm-6">
                <textarea ng-model="book.blurb" name="blurb" id="blurb" rows="5" cols="45">

                </textarea>
            </div>
        </div>

    </form>
    <div id="error-alert" class="alert alert-danger fade in" role="alert" ng-show="errorMsg">
        <p id="error-message">
            错误：{{errorMsg}}
        </p>
    </div>

</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" ng-click="cancel()">取消</button>
    <button type="button" class="btn btn-primary" ng-click="save()">保存</button>
</div>
